import babel from '@rollup/plugin-babel';
import serve from 'rollup-plugin-serve';
let ENV = (process.env.NODE_ENV).trim();
const isDev = ENV == 'development';
export default {
	input: './src/index.js',
	output: {
		file: 'dist/umd/vue.js', // 打包到什么目录下
		format: 'umd',
		name: 'Vue', // 打包后挂载在全局下的变量
		sourcemap: isDev // 是否开启源码调试
	},
	plugins: [
		isDev ? serve({
			open: true,
			openPage: '/public/index.html',
			port: 3000,
			contentBase: ''
		}) : null,
		babel({
			exclude: 'node_modules/**',
		})
	]
}